{extend name="common/common" /}
   
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="layui-col-sm6" style="padding:5px;">
        <div class="ibox-title">
            <h5>网站设置</h5>
        </div>
        <div class="ibox-content">
			<form class="layui-form layui-form-pane" id="commentForm" method="post" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">网站域名:</label>
					<div class="layui-input-block">
						<input value="{$Webset.DNSname|default=''}" type="text" class="form-control" name="DNSname" required="" aria-required="true">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">系统名称:</label>
					<div class="layui-input-block">
						<input value="{$Webset.title|default=''}" type="text" class="form-control" name="title" required="" aria-required="true">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">系统版权:</label>
					<div class="layui-input-block">
						<input value="{$Webset.copyright|default=''}" type="text" class="form-control" name="copyright" required="" aria-required="true">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">网站logo:</label>
					<div class="layui-input-block">
						<input value="{$Webset.logo|default=''}" type="text" class="form-control" data-action="setlogo" data-multiple="false" data-ext="png,jpg,jpeg" data-upload="logo/logo" name="logo" readonly>
						<em>220*60</em>
					</div>

				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">迷你logo:</label>
					<div class="layui-input-block">
						<input value="{$Webset.mini_logo|default=''}" type="text" class="form-control" data-action="setmini_logo" data-multiple="false" data-ext="png,jpg,jpeg" data-upload="logo/mini_logo" name="mini_logo" readonly>
						<i>70*60</i>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">附件类型:</label>
					<div class="layui-input-block">
						<input value="{$Webset.ext|default=''}" type="text" class="form-control" name="ext" required="" aria-required="true">
						<i>用 "-" 间隔</i>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">上传限制:</label>
					<div class="layui-input-block">
						<input value="{$Webset.max_size_of_upload|default=''}" type="number" step="0.1" class="form-control" name="max_size_of_upload" required="" aria-required="true">
						<i>单位:Mb</i>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">日志时限:</label>
					<div class="layui-input-block">
						<input value="{$Webset.log_expire|default=''}" type="number" class="form-control" name="log_expire" required="" aria-required="true">
						<i>日志的保留时间,单位:天</i>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">还款日期:</label>
					<div class="layui-input-block">
						<input value="{$Webset.pay_date|default=''}" type="number" class="form-control" name="pay_date" required="" aria-required="true">
						<i>分期付款还款日期,每个月的几号</i>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">客户释放:</label>
					<div class="layui-input-block">
						<input value="{$Webset.release_customer|default=''}" type="number" class="form-control" name="release_customer" required="" aria-required="true">
						<i>客户录入多少天后没有成交释放,单位:天</i>
					</div>
				</div>

				<div class="layui-form-item" pane="">
				    <label class="layui-form-label">开发者模式:</label>
				    <div class="layui-input-block">
				    	{if condition="$Webset.app_debug == 'true'"}
				    	<input type="checkbox" lay-skin="switch" checked lay-filter="switchDebug" title="开关">
				    	{else}
				    	<input type="checkbox" lay-skin="switch" lay-filter="switchDebug" title="开关">
				    	{/if}
				    	<input value="{$Webset.app_debug|default=''}" type="hidden" class="form-control" id="switchDebug" name="app_debug">
				    	<input value="{$Webset.app_trace|default=''}" type="hidden" id="switchTrace" class="form-control" name="app_trace">
				    </div>
			  	</div>

				<div class="layui-form-item">
					<label class="layui-form-label" style="background:none;border:none;"></label>
					<button id="submit" class="btn btn-info">保存</button>
				</div>
			</form>
        </div>
	</div>
</div>
{/block}

{block name="script"}
<script type="text/javascript">
$(function(){
	$('#submit').on('click',function(){
		var params = $('#commentForm').serialize();
		$.post("subForm",params,function(res){
			response(res);
		})
		return false;
	});

	layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听指定开关
		form.on('switch(switchDebug)', function(data){
			if(this.checked){
				$('#switchDebug').val(true);
				$('#switchTrace').val(true);
			}else{
				$('#switchDebug').val(false);
				$('#switchTrace').val(false);
			}
		});
    });
})
</script>
{/block}
